<?php

class Skjb_Office_Spreadsheet_Exporter_Excel2007Xml_CoreProperties
{
    public function toXml()
    {
        $xml = new XMLWriter();
        $xml->openMemory();
        $xml->startDocument('1.0', 'UTF-8', 'yes');
        
        $xml->startElement('cp:coreProperties');
        $xml->writeAttribute('xmlns:cp', 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties');
        $xml->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
        $xml->writeAttribute('xmlns:dcterms', 'http://purl.org/dc/terms/');
        $xml->writeAttribute('xmlns:dcmitype', 'http://purl.org/dc/dcmitype/');
        $xml->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
        
        $xml->writeElement('dc:creator', 'Camaro');
        $xml->writeElement('cp:lastModifiedBy', 'Camaro');
        
        $xml->startElement('dcterms:created');
        $xml->writeAttribute('xsi:type', 'dcterms:W3CDTF');
        $xml->writeRaw('2010-05-28T12:00:48Z');
        $xml->endElement(); // dcterms:created
        
        $xml->startElement('dcterms:modified');
        $xml->writeAttribute('xsi:type', 'dcterms:W3CDTF');
        $xml->writeRaw('2010-05-28T12:02:02Z');
        $xml->endElement(); // dcterms:modified
        
        $xml->endElement(); // cp:coreProperties
        
        $xml->endDocument();
        
        return $xml->outputMemory();
    }
}
